package OOA.com.JavaBasis.diversity;

public class Teacher extends Emp implements Consultant,Author{
    @Override
    public void edit() {
        System.out.println("编辑文档");
    }

    @Override
    public void answer() {
        System.out.println("回答问题");
    }

    @Override
    public void training() {
        System.out.println("培训学员");
    }

    @Override
    public void work() {
        System.out.println("讲师授课");
    }

    public static void main(String[] args) {
        //创建教师对象
        Teacher teacher = new Teacher();
        teacher.clockup();
        teacher.answer();
        teacher.edit();
        teacher.training();
        teacher.work();
        teacher.clockdown();
        System.out.println("======================");

        //向上造型，注意只能调用父类中有的方法
        Emp emp = teacher;
        emp.work();
        emp.clockup();
        emp.clockdown();
        System.out.println("=======================");

        Consultant consultant = teacher;
        consultant.answer();
        consultant.training();
        System.out.println("======================");

        Author author = teacher;
        author.edit();
    }
}
